<?php
class Project_Comment_m extends MY_Model{
	
	function __construct(){
		parent::__construct();
		$this->_table = 'business_project_comment';
		date_default_timezone_set('Asia/Ho_Chi_Minh');
	}
	
	public function insert($data){
		$data['created'] = strtotime(date('Y-m-d H:i:s'));
		//print_r($data);exit;
		return parent::insert($data);
	}
	
	public function get_all($project_id){
		$this->_table = 'business_project_comment c';
		$this->db->select('c.*,u.display_name,u.username');
		$this->db->join('ser_users u','u.id = c.user_id');
		$this->db->where('project_id',$project_id);
		$this->db->order_by('c.created','desc');
		$result = parent::get_all();
		return $result;
	}
	
	
}